Integrand size = 26, antiderivative size = 51 \[ \int \frac {(e+f x) \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {e x}{a}+\frac {f x^2}{2 a}+\frac {(e+f x) \cos (c+d x)}{a d}-\frac {f \sin (c+d x)}{a d^2} \]
Time = 1.45 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.04 \[ \int \frac {(e+f x) \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {(c+d x) (-2 d e+c f-d f x)-2 d (e+f x) \cos (c+d x)+2 f \sin (c+d x)}{2 a d^2} \]
-1/2*((c + d*x)*(-2*d*e + c*f - d*f*x) - 2*d*(e + f*x)*Cos[c + d*x] + 2*f* Sin[c + d*x])/(a*d^2)
Time = 0.32 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {5034, 17, 3042, 3777, 3042, 3117}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {(e+f x) \cos ^2(c+d x)}{a \sin (c+d x)+a} \, dx\) |
\(\Big \downarrow \) 5034 |
\(\displaystyle \frac {\int (e+f x)dx}{a}-\frac {\int (e+f x) \sin (c+d x)dx}{a}\) |
\(\Big \downarrow \) 17 |
\(\displaystyle \frac {(e+f x)^2}{2 a f}-\frac {\int (e+f x) \sin (c+d x)dx}{a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {(e+f x)^2}{2 a f}-\frac {\int (e+f x) \sin (c+d x)dx}{a}\) |
\(\Big \downarrow \) 3777 |
\(\displaystyle \frac {(e+f x)^2}{2 a f}-\frac {\frac {f \int \cos (c+d x)dx}{d}-\frac {(e+f x) \cos (c+d x)}{d}}{a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {(e+f x)^2}{2 a f}-\frac {\frac {f \int \sin \left (c+d x+\frac {\pi }{2}\right )dx}{d}-\frac {(e+f x) \cos (c+d x)}{d}}{a}\) |
\(\Big \downarrow \) 3117 |
\(\displaystyle \frac {(e+f x)^2}{2 a f}-\frac {\frac {f \sin (c+d x)}{d^2}-\frac {(e+f x) \cos (c+d x)}{d}}{a}\) |
3.3.59.3.1 Defintions of rubi rules used
Int[(c_.)*((a_.) + (b_.)*(x_))^(m_.), x_Symbol] :> Simp[c*((a + b*x)^(m + 1 )/(b*(m + 1))), x] /; FreeQ[{a, b, c, m}, x] && NeQ[m, -1]
Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]
Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[( -(c + d*x)^m)*(Cos[e + f*x]/f), x] + Simp[d*(m/f) Int[(c + d*x)^(m - 1)*C os[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]
Int[(Cos[(c_.) + (d_.)*(x_)]^(n_)*((e_.) + (f_.)*(x_))^(m_.))/((a_) + (b_.) *Sin[(c_.) + (d_.)*(x_)]), x_Symbol] :> Simp[1/a Int[(e + f*x)^m*Cos[c + d*x]^(n - 2), x], x] - Simp[1/b Int[(e + f*x)^m*Cos[c + d*x]^(n - 2)*Sin[ c + d*x], x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[n, 1] && EqQ[a^ 2 - b^2, 0]
Time = 0.18 (sec) , antiderivative size = 44, normalized size of antiderivative = 0.86
method | result | size |
parallelrisch | \(\frac {d \cos \left (d x +c \right ) \left (f x +e \right )-f \sin \left (d x +c \right )+\left (x \left (\frac {f x}{2}+e \right ) d +e \right ) d}{a \,d^{2}}\) | \(44\) |
risch | \(\frac {e x}{a}+\frac {f \,x^{2}}{2 a}+\frac {\left (f x +e \right ) \cos \left (d x +c \right )}{a d}-\frac {f \sin \left (d x +c \right )}{a \,d^{2}}\) | \(50\) |
derivativedivides | \(\frac {-\cos \left (d x +c \right ) c f +\cos \left (d x +c \right ) d e -f \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )-f c \left (d x +c \right )+e d \left (d x +c \right )+\frac {f \left (d x +c \right )^{2}}{2}}{d^{2} a}\) | \(78\) |
default | \(\frac {-\cos \left (d x +c \right ) c f +\cos \left (d x +c \right ) d e -f \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )-f c \left (d x +c \right )+e d \left (d x +c \right )+\frac {f \left (d x +c \right )^{2}}{2}}{d^{2} a}\) | \(78\) |
norman | \(\frac {\frac {2 e}{d a}+\frac {f \,x^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {f \,x^{2} \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {\left (d e +f \right ) x}{d a}-\frac {2 f \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a \,d^{2}}+\frac {\left (2 d e -2 f \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a \,d^{2}}+\frac {\left (d e -f \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}+\frac {\left (d e -f \right ) x \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}+\frac {\left (d e +f \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d a}+\frac {f \,x^{2}}{2 a}+\frac {2 e x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {2 e x \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {f \,x^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a}+\frac {f \,x^{2} \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}+\frac {f \,x^{2} \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}+\frac {2 \left (d e -f \right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a \,d^{2}}+\frac {2 \left (d e -f \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a \,d^{2}}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}\) | \(364\) |
Time = 0.26 (sec) , antiderivative size = 49, normalized size of antiderivative = 0.96 \[ \int \frac {(e+f x) \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {d^{2} f x^{2} + 2 \, d^{2} e x + 2 \, {\left (d f x + d e\right )} \cos \left (d x + c\right ) - 2 \, f \sin \left (d x + c\right )}{2 \, a d^{2}} \]
Leaf count of result is larger than twice the leaf count of optimal. 326 vs. \(2 (41) = 82\).
Time = 1.30 (sec) , antiderivative size = 326, normalized size of antiderivative = 6.39 \[ \int \frac {(e+f x) \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\begin {cases} \frac {2 d^{2} e x \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d^{2}} + \frac {2 d^{2} e x}{2 a d^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d^{2}} + \frac {d^{2} f x^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d^{2}} + \frac {d^{2} f x^{2}}{2 a d^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d^{2}} + \frac {4 d e}{2 a d^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d^{2}} - \frac {2 d f x \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d^{2}} + \frac {2 d f x}{2 a d^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d^{2}} - \frac {4 f \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d^{2}} & \text {for}\: d \neq 0 \\\frac {\left (e x + \frac {f x^{2}}{2}\right ) \cos ^{2}{\left (c \right )}}{a \sin {\left (c \right )} + a} & \text {otherwise} \end {cases} \]
Piecewise((2*d**2*e*x*tan(c/2 + d*x/2)**2/(2*a*d**2*tan(c/2 + d*x/2)**2 + 2*a*d**2) + 2*d**2*e*x/(2*a*d**2*tan(c/2 + d*x/2)**2 + 2*a*d**2) + d**2*f* x**2*tan(c/2 + d*x/2)**2/(2*a*d**2*tan(c/2 + d*x/2)**2 + 2*a*d**2) + d**2* f*x**2/(2*a*d**2*tan(c/2 + d*x/2)**2 + 2*a*d**2) + 4*d*e/(2*a*d**2*tan(c/2 + d*x/2)**2 + 2*a*d**2) - 2*d*f*x*tan(c/2 + d*x/2)**2/(2*a*d**2*tan(c/2 + d*x/2)**2 + 2*a*d**2) + 2*d*f*x/(2*a*d**2*tan(c/2 + d*x/2)**2 + 2*a*d**2) - 4*f*tan(c/2 + d*x/2)/(2*a*d**2*tan(c/2 + d*x/2)**2 + 2*a*d**2), Ne(d, 0 )), ((e*x + f*x**2/2)*cos(c)**2/(a*sin(c) + a), True))
Leaf count of result is larger than twice the leaf count of optimal. 151 vs. \(2 (49) = 98\).
Time = 0.29 (sec) , antiderivative size = 151, normalized size of antiderivative = 2.96 \[ \int \frac {(e+f x) \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {4 \, c f {\left (\frac {1}{a d + \frac {a d \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}} + \frac {\arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a d}\right )} - 4 \, e {\left (\frac {\arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac {1}{a + \frac {a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}}\right )} - \frac {{\left ({\left (d x + c\right )}^{2} + 2 \, {\left (d x + c\right )} \cos \left (d x + c\right ) - 2 \, \sin \left (d x + c\right )\right )} f}{a d}}{2 \, d} \]
-1/2*(4*c*f*(1/(a*d + a*d*sin(d*x + c)^2/(cos(d*x + c) + 1)^2) + arctan(si n(d*x + c)/(cos(d*x + c) + 1))/(a*d)) - 4*e*(arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a + 1/(a + a*sin(d*x + c)^2/(cos(d*x + c) + 1)^2)) - ((d*x + c) ^2 + 2*(d*x + c)*cos(d*x + c) - 2*sin(d*x + c))*f/(a*d))/d
Leaf count of result is larger than twice the leaf count of optimal. 322 vs. \(2 (49) = 98\).
Time = 0.30 (sec) , antiderivative size = 322, normalized size of antiderivative = 6.31 \[ \int \frac {(e+f x) \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {d^{2} f x^{2} \tan \left (\frac {1}{2} \, d x\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + 2 \, d^{2} e x \tan \left (\frac {1}{2} \, d x\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + d^{2} f x^{2} \tan \left (\frac {1}{2} \, d x\right )^{2} + d^{2} f x^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + 2 \, d f x \tan \left (\frac {1}{2} \, d x\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + 2 \, d^{2} e x \tan \left (\frac {1}{2} \, d x\right )^{2} + 2 \, d^{2} e x \tan \left (\frac {1}{2} \, c\right )^{2} + 2 \, d e \tan \left (\frac {1}{2} \, d x\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + d^{2} f x^{2} - 2 \, d f x \tan \left (\frac {1}{2} \, d x\right )^{2} - 8 \, d f x \tan \left (\frac {1}{2} \, d x\right ) \tan \left (\frac {1}{2} \, c\right ) - 2 \, d f x \tan \left (\frac {1}{2} \, c\right )^{2} + 2 \, d^{2} e x - 2 \, d e \tan \left (\frac {1}{2} \, d x\right )^{2} - 8 \, d e \tan \left (\frac {1}{2} \, d x\right ) \tan \left (\frac {1}{2} \, c\right ) + 4 \, f \tan \left (\frac {1}{2} \, d x\right )^{2} \tan \left (\frac {1}{2} \, c\right ) - 2 \, d e \tan \left (\frac {1}{2} \, c\right )^{2} + 4 \, f \tan \left (\frac {1}{2} \, d x\right ) \tan \left (\frac {1}{2} \, c\right )^{2} + 2 \, d f x + 2 \, d e - 4 \, f \tan \left (\frac {1}{2} \, d x\right ) - 4 \, f \tan \left (\frac {1}{2} \, c\right )}{2 \, {\left (a d^{2} \tan \left (\frac {1}{2} \, d x\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + a d^{2} \tan \left (\frac {1}{2} \, d x\right )^{2} + a d^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + a d^{2}\right )}} \]
1/2*(d^2*f*x^2*tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*d^2*e*x*tan(1/2*d*x)^2*tan( 1/2*c)^2 + d^2*f*x^2*tan(1/2*d*x)^2 + d^2*f*x^2*tan(1/2*c)^2 + 2*d*f*x*tan (1/2*d*x)^2*tan(1/2*c)^2 + 2*d^2*e*x*tan(1/2*d*x)^2 + 2*d^2*e*x*tan(1/2*c) ^2 + 2*d*e*tan(1/2*d*x)^2*tan(1/2*c)^2 + d^2*f*x^2 - 2*d*f*x*tan(1/2*d*x)^ 2 - 8*d*f*x*tan(1/2*d*x)*tan(1/2*c) - 2*d*f*x*tan(1/2*c)^2 + 2*d^2*e*x - 2 *d*e*tan(1/2*d*x)^2 - 8*d*e*tan(1/2*d*x)*tan(1/2*c) + 4*f*tan(1/2*d*x)^2*t an(1/2*c) - 2*d*e*tan(1/2*c)^2 + 4*f*tan(1/2*d*x)*tan(1/2*c)^2 + 2*d*f*x + 2*d*e - 4*f*tan(1/2*d*x) - 4*f*tan(1/2*c))/(a*d^2*tan(1/2*d*x)^2*tan(1/2* c)^2 + a*d^2*tan(1/2*d*x)^2 + a*d^2*tan(1/2*c)^2 + a*d^2)
Time = 2.57 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.04 \[ \int \frac {(e+f x) \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {\frac {f\,x^2}{2}+e\,x}{a}-\frac {f\,\sin \left (c+d\,x\right )-d\,\left (e\,\cos \left (c+d\,x\right )+f\,x\,\cos \left (c+d\,x\right )\right )}{a\,d^2} \]